file = open("C:\\Users\\Administrator\\Desktop\\实验九\\xiaofei.csv", "r")
ls = []

# 将CSV文件中的二维数据读入到列表中
for line in file:
    line = line.replace("\n", "")
    ls.append(line.split(","))
    lns = ''
    for s in ls:
        lns += '{}\n'.format(s)
# print(lns)
print(ls[1])

str1 = input("请输入你要查询的城市和项目，以空格分隔：\n")
str__split = str1.split(" ")


# print(str__split)

def find(str, list):
    list1 = []
    for line in list:
        for s in line:
            if s == str[0]:
                list1 = line
                print(list1)
    for s in str:
        print("消费支出：", list1[1])


find(str__split, ls)
